package org.xxx.epms.models.epms.controller;


import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.xxx.epms.common.api.CommonResult;
import org.xxx.epms.models.epms.model.AqiGrade;
import org.xxx.epms.models.epms.service.AqiGradeService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lb
 * @since 2024-06-08
 */
@RestController
@RequestMapping("/epms/aqiGrade")
public class AqiGradeController {

    @Autowired
    private AqiGradeService aqiGradeService;

    @ApiOperation("根据AQI等级获取AQI信息")
    @RequestMapping(value = "/getAqiGradeByLevel",method = RequestMethod.GET)
    public CommonResult<AqiGrade> getAqiGradeByLevel(@RequestParam("aqiLevel") Integer aqiLevel){
        return CommonResult.success(aqiGradeService.getAqiGradeByLevel(aqiLevel));
    }
}

